home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / scripttex / screenplay.tex < prev    next >
Text File  |  1992-08-26  |  12KB  |  459 lines

  1. % ScriptTeX screenplay macros -- typed manuscript version
  2. % Copyright 1991 Adrian McCarthy.  See documentation for re-distribution info.
  3. \def\banner{ScriptTeX 1.03, 24-OCT-91, typed screenplay format}%version
  4. \immediate\write16{\banner}
  5. %
  6. % These macros will produce a manuscript that looks as though it were typed.
  7. %
  8. % With the fixed pitch font and narrow dialog paragraphs, I've set the
  9. % penalties and such to be extremely tolerant of TeX's concept of badness.
  10. % These are probably more extreme than they have to be, but they can be
  11. % tuned later.
  12. %
  13. \font\mainfont=cmpica % Don Hosek's pica fonts.  Use cmtt12 if not available.
  14. \font\emfont=cmpicati % Change to underlined \mainfont if not available.
  15. \mainfont
  16. \pretolerance=500 % acceptable "badness" before trying to hyphenate
  17. \tolerance=10000  % acceptable "badness" of a line
  18. \linepenalty=0    % penalty for each line in a paragraph
  19. \adjdemerits=0    % demerits for adjacent tight and loose line juxtapositions
  20. \finalhyphendemerits=0 % demerits for hyphenating the penultimate line
  21. \doublehyphendemerits=0 % demerits for hyphenating consecutive lines
  22. \hbadness=10000   % avoid useless underfull hbox messages
  23. %
  24. % General page layout:
  25. %
  26. \newdimen\lineskip \lineskip=12bp % 6 lines per inch
  27. \newdimen\charwid {\setbox0=\hbox{\mainfont M} \global\charwid=\wd0}
  28. \baselineskip=\lineskip  % 2\lineskip for sitcoms
  29. \spaceskip=\charwid   % for true typewriter spacing (redundant in cmtt)
  30. \xspaceskip=2\charwid % for two spaces after a sentence (redundant in cmtt)
  31. \voffset=-4\lineskip % 1 blank line from top
  32. \hoffset=0.5truein   % extra room for hole punch
  33. \vsize=58\lineskip
  34. \hsize=60\charwid
  35. \parindent 0pt
  36. \parskip\baselineskip
  37. \splittopskip=\topskip
  38. \splitmaxdepth=\maxdepth
  39. \newdimen\rightmar
  40. \def\hotzone{8\charwid} % right margin hotzone
  41. \def\margins#1#2{%
  42.   \leftskip=#1
  43.   \rightmar=\hsize \advance\rightmar by -\leftskip \advance\rightmar by -#2
  44.   \rightskip=\rightmar plus \hotzone
  45. }
  46. %
  47. % My first output routine.  Marks have six parts:  act/scene header,
  48. % previous scene continued, dialog continued, \nukeline for (MORE),
  49. % continuing dialog (MORE), \nukeline for continuing scene, and
  50. % continuing scene.  The seventh part is reserved for rev pages.
  51. % I realize that I use \splitbotmark before a \vsplit is ever done, but
  52. % this is correct.  \topmark has the wrong value if I put back lines back
  53. % during the previous \output run.
  54. %
  55. \output={%
  56.   \dimen0=\ht255
  57.   \ifx\LR\empty \else
  58.     \if L\LR \hoffset=0.0truein \global\def\LR{R}
  59.       \else \hoffset=0.5truein \global\def\LR{L}
  60.     \fi
  61.   \fi%x
  62.   \shipout\vbox to 62\lineskip{%
  63.     \boxmaxdepth=\maxdepth%
  64.     \makeheadline%
  65.     \pagebody%
  66.     \makefootline%
  67.   }
  68.   \unvbox255 \penalty\outputpenalty % put back unused text
  69.   \advancepageno
  70. }
  71. \def\makeheadline{%  Act/scene header and page number
  72.   \line{%
  73.     \mainfont%
  74.     \ifcase1\expandafter\relax\splitbotmark\fi%
  75.     \ifnum\pageno>0 \hss \folio\rlap{.}\fi}
  76.   \vskip\lineskip
  77. }
  78. \def\pagebody{%
  79.   \ifcase2\expandafter\relax\splitbotmark\fi   % So-and-so (CONT'D) \nukeline
  80.   \ifcase3\expandafter\relax\botmark\fi        % \nukeline for (MORE)
  81.   \ifcase5\expandafter\relax\botmark\fi        % \nukelines for CONTINUED
  82.   {%
  83.     \vbadness=10000
  84.     \setbox0=\vsplit255 to \dimen0             % split to new height
  85.     \unvbox0                                   % put page into output
  86.   }%
  87.   \ifcase4\expandafter\relax\splitbotmark\fi   % (MORE)
  88.   \ifcase6\expandafter\relax\splitbotmark\fi   %   CONTINUED
  89.   \kern-\dimen0 \vfil % kern keeps \vfil from being discarded
  90. }
  91. \def\makefootline{%
  92.   \vskip\lineskip
  93.   \line{\mainfont \footer}
  94. }
  95. \def\nukeline{%
  96.   \advance\dimen0 by -\lineskip
  97. }
  98. \def\mymark{{
  99.   \header \noexpand\or %
  100.   \contprevscene \noexpand\or %
  101.   \contprevdialog \noexpand\or %
  102.   \contdialoga \noexpand\or %
  103.   \contdialogb \noexpand\or %
  104.   \contscenea \noexpand\or %
  105.   \contsceneb %\noexpand\or
  106. % \contrev
  107. }}
  108. \def\contprevscene{}
  109. \def\contprevdialog{}
  110. \def\contdialoga{}
  111. \def\contdialogb{}
  112. \def\contscenea{}
  113. \def\contsceneb{}
  114. %\def\contrev{}
  115. %
  116. % Revision information
  117. %
  118. \def\titletext{Screenplay}
  119. \def\title#1{\def\titletext{#1}}
  120. \def\seriestext{}
  121. \def\series#1{\def\seriestext{#1}}
  122. \def\authortext{}
  123. \def\author#1{\def\authortext{#1}}
  124. \def\drafttext{}
  125. \def\draft#1{\def\drafttext{\uppercase{#1}}}
  126. \def\basedon#1{\def\basedontext{#1}}
  127. \def\basedontext{}
  128. \def\showcopyright#1{\def\copyrighttext{$\copyright$~#1}}
  129. \def\copyrighttext{}
  130. \def\address#1{\def\addresstext{\vtop{\settabs 1\columns \tabalign #1\cr}}}
  131. \def\\{\cr\tabalign}
  132. \def\addresstext{}
  133. \def\today{%
  134.   \hbox{\number\day-\ifcase\month\or JAN\or FEB\or MAR\or APR\or MAY%
  135.     \or JUN\or JUL\or AUG\or SEP\or OCT\or NOV\or DEC\fi%
  136.     -\number\year}%
  137. }
  138. \edef\datetext{\today}  % \edef for efficiency; it won't change during job
  139. \def\date#1{\def\datetext{#1}}
  140. %
  141. % We count acts and scenes for you.
  142. %
  143. \newcount\actcnt \actcnt=0
  144. \def\currentact{}
  145. \newcount\scenecnt \scenecnt=0
  146. \def\resetscenecnt{\scenecnt=0}
  147. \def\currentscene{}
  148. \def\stdhang{\leavevmode\llap{\number\scenecnt.\ }}
  149. \def\stdhead{\ifx\currentscene\empty \else \number\scenecnt.\fi}
  150. \def\stdfoot{%
  151.   \ifx\seriestext\empty \else
  152.     {\emfont \seriestext} \hss
  153.   \fi%
  154.   ``\titletext'' \hss \drafttext
  155. }
  156. \def\stdxref{%
  157.   \ifx\currentact\empty \else%
  158.     \currentact; %
  159.   \fi%
  160.   \ifx\currentscene\empty \else%
  161.     \currentscene%
  162.   \fi
  163. }
  164. \def\Roman#1{\uppercase\expandafter{\romannumeral#1}}
  165. \def\roman#1{\romannumeral#1}
  166. %
  167. % Keep track of last speaker.
  168. %
  169. \global\def\lastspeaker{}
  170. %
  171. % Variants
  172. %
  173. \def\LR{}
  174. \def\twoside{\def\LR{R}}
  175. \def\jlbrooks{
  176.   \hsize=65\charwid
  177.   \def\hotzone{3\charwid}
  178.   \hfuzz=5\charwid
  179. }
  180. \def\movie{
  181.   \def\resetscenecnt{}
  182.   \def\actheadblock##1{}
  183.   \def\acttailblock{}
  184.   \def\actpgbreak{}
  185.   \def\stdxref{}
  186. }
  187. \def\TV{}
  188. \def\sitcom{\lineskip=24bp}
  189. \def\manuscript{
  190.   \def\header{}
  191.   \def\footer{}
  192.   \def\hangscene{}
  193.   \def\draftblock{}
  194.   \def\stdxref{}
  195.   \def\sound##1{##1}
  196. }
  197. \def\proof{
  198.   \ifx\drafttext\empty \draft{Working Draft}\fi
  199.   \def\header{\stdhead}
  200.   \def\footer{\stdfoot}
  201.   \def\hangscene{\stdhang}
  202.   \def\sound##1{##1}
  203. }
  204. \def\shoot{
  205.   \ifx\drafttext\empty \draft{Shooting Script}\fi
  206.   \def\header{}
  207.   \def\footer{}
  208.   \def\hangscene{\stdhang}
  209. }
  210. %
  211. % Breakdowns (desupported)
  212. %
  213. \def\makecastlist{\immediate\write16{Cast lists no longer supported.}}
  214. \def\collectcast{\immediate\write16{Cast lists no longer supported.}}
  215. \def\makescenelist{\immediate\write16{Scene lists no longer supported.}}
  216. \def\collectscenes{\immediate\write16{Scene lists no longer supported.}}
  217. %
  218. % Make a title page
  219. %
  220. \def\maketitle{%
  221.   \ifx\LR\empty \else \def\LR{R} \fi
  222.   \hbox{}
  223.   \vskip 2in
  224.   \ifx\seriestext\empty \else 
  225.     \centerline{{\emfont \uppercase{\seriestext}}}
  226.     \vskip 3\baselineskip
  227.   \fi
  228.   \centerline{``\uppercase{\titletext}''}
  229.   \vskip\baselineskip
  230.   \ifx\authortext\empty \else
  231.     \centerline{\authortext}
  232.   \fi
  233.   \vskip\baselineskip
  234.   \centerline{\basedontext}
  235.   \vskip 3.5in
  236.   \line{\copyrighttext\hfill\addresstext}
  237.   \vskip 3\baselineskip
  238.   \draftblock
  239.   \pageno=0
  240.   {
  241.     \def\header{}
  242.     \def\footer{}
  243.     \eject
  244.   }
  245.   \pageno=1
  246. }
  247. \def\draftblock{%
  248.   \ifx\drafttext\empty \else
  249.     \rightline{{\emfont \uppercase{\drafttext}}}
  250.   \fi
  251.   \rightline{\datetext}
  252. }
  253. %
  254. % Standard header for acts, tags, and teasers
  255. %
  256. \def\actpgbreak{\vfill \penalty-10000}
  257.  
  258. \def\actheadblock#1{
  259.   \vskip 2\lineskip
  260.   \centerline{{\emfont \uppercase{#1}}}
  261.   \vskip 4\lineskip
  262. }
  263. \def\acttailblock{
  264.   \vskip 2\lineskip
  265.   {\edef\tempact{end of \currentact}
  266.     \centerline{{\emfont \uppercase\expandafter{\tempact}}}
  267.   }
  268. }
  269. \def\acthead#1{%
  270.   \acttail
  271.   \advance\actcnt by 1
  272.   \resetscenecnt
  273.   \edef\currentact{#1}
  274.   \def\contprevscene{}
  275.   \def\contprevdialog{}
  276.   \def\contdialoga{}
  277.   \def\contdialogb{}
  278.   \def\contscenea{}
  279.   \def\contsceneb{}
  280.   \expandafter\mark\mymark
  281.   \actpgbreak
  282.   \parskip\baselineskip
  283.   \actheadblock{#1}
  284.   \immediate\write16{#1}
  285. }
  286. %
  287. % Standard tail for acts, tags, and teasers
  288. %
  289. \def\acttail{%
  290.   \penalty1000
  291.   \ifx\currentact\empty \else
  292.     \acttailblock
  293.     \def\currentact{}
  294.   \fi
  295. }
  296. %
  297. % Regular script constructs:
  298. %
  299. \def\act{\acthead{Act \ifcase\actcnt\or One\or Two\or Three\or Four\or
  300.      Five\or Six\or Seven\or Eight\or Nine\or Ten\or Eleven\or
  301.      Twelve\or Thirteen\or Fourteen\or Fifteen\or Sixteen\else\Roman\actcnt\fi}
  302. }
  303. \def\teaser{\acthead{Teaser}\actcnt=0}
  304. \def\tag{\acthead{Tag}}
  305. \def\prolog{\acthead{Prolog}\actcnt=0}
  306. \def\epilog{\acthead{Epilog}}
  307. \def\prologue{\acthead{Prologue}\actcnt=0}
  308. \def\epilogue{\acthead{Epilogue}}
  309. \def\theend{
  310.   \def\acttailblock{
  311.     \vskip 2\lineskip
  312.     \centerline{{\emfont THE END}}
  313.   }
  314. }
  315.  
  316. \def\scene#1{%
  317.   \penalty10000
  318.   \def\contprevscene{}
  319.   \def\contprevdialog{}
  320.   \def\contdialoga{}
  321.   \def\contdialogb{}
  322.   \def\contscenea{}
  323.   \def\contsceneb{}
  324.   \expandafter\mark\mymark
  325.   \penalty-100
  326.   \advance\scenecnt by 1
  327.   \edef\currentscene{Scene \number\scenecnt}
  328.   \parskip\baselineskip
  329.   \margins{0in}{\hsize}
  330.   \leavevmode\hangscene\uppercase{#1}\par
  331.   \def\contprevscene{\hangscene CONTINUED}
  332.   \def\contscenea{\nukeline\nukeline}
  333.   \def\contsceneb{\vskip\lineskip \line{\hskip 40\charwid CONTINUED}}
  334.   \expandafter\mark\mymark
  335.   \global\def\lastspeaker{}
  336.   \penalty1000
  337. }
  338. \def\shot#1{\scene{#1}}
  339.  
  340. \def\stage{%
  341.   \penalty10000
  342.   \def\contprevdialog{}
  343.   \def\contdialoga{}
  344.   \def\contdialogb{}
  345.   \expandafter\mark\mymark
  346.   \penalty-100
  347.   \margins{0in}{\hsize}
  348.   \parskip\baselineskip
  349. }
  350.  
  351. \def\trans#1{%
  352.   \def\contprevdialog{}
  353.   \def\contdialoga{}
  354.   \def\contdialogb{}
  355.   \expandafter\mark\mymark
  356.   \parskip\baselineskip
  357.   \penalty100
  358.   {\margins{40\charwid}{20\charwid} \uppercase{#1} \par}
  359.   \penalty-100
  360. }
  361.  
  362. \def\open#1{%
  363.   \def\contprevscene{}
  364.   \def\contprevdialog{}
  365.   \def\contdialoga{}
  366.   \def\contdialogb{}
  367.   \def\contscenea{}
  368.   \def\contsceneb{}
  369.   \expandafter\mark\mymark
  370.   \parskip\baselineskip
  371.   {\margins{0in}{\hsize} \uppercase{#1} \par}
  372. }
  373.  
  374. \def\close#1{\open{#1}}
  375.  
  376. \def\dialog#1#2\par{%
  377.   \penalty10000 % make sure we don't break until after the clear mark
  378.   \def\contprevdialog{}
  379.   \def\contdialoga{}
  380.   \def\contdialogb{}
  381.   \expandafter\mark\mymark
  382.   \penalty-100 % OK to break now
  383.   \parskip\lineskip
  384.   {\margins{24\charwid}{36\charwid} \uppercase{#1}%
  385.     \global\def\thisspeaker{#1}%
  386.     \ifx\thisspeaker\lastspeaker \ (CONT'D)\fi
  387.     \global\def\lastspeaker{#1}
  388.   \par}
  389.   \parskip 0pt
  390.   \def\contprevdialog{%
  391.     \nukeline%
  392.     \line{\hskip 24\charwid \uppercase{#1} (CONT'D)}%
  393.   }
  394.   \def\contdialoga{\nukeline}
  395.   \def\contdialogb{\line{\hskip 24\charwid (MORE)}}
  396.   \expandafter\mark\mymark
  397.   \margins{10\charwid}{35\charwid} % rightmar = \hsize-\leftskip-35\charwid
  398.   \penalty10000
  399.   #2\par
  400.   \stage
  401. }
  402.  
  403. \def\paren#1#2\par{%
  404.   \par
  405.   \penalty10000
  406.   {%
  407.     \margins{17\charwid}{20\charwid} % rightmar = \hsize-\leftskip-20\charwid
  408.     (#1)%
  409.     \par%
  410.   }
  411.   \penalty10000
  412.   #2\par
  413.   \stage
  414. }
  415.  
  416. \def\leadin#1{#1~\ldots\par\penalty200}  % These are more exciting in the
  417. \def\pickup{\ldots~}                     % stageplay format.
  418.  
  419. \def\em#1{{\emfont #1}}
  420. \def\extra#1{\uppercase\expandafter{#1}}
  421. \def\introduce#1{\uppercase\expandafter{#1}}
  422. \def\sound#1{\uppercase{#1}}
  423. \def\ldots{.~.~.}  % Formal typing version.  OK to use "..."
  424.  
  425. \def\cleanup{%
  426.   \par
  427.   \acttail
  428.   \def\contdialoga{}
  429.   \def\contdialogb{}
  430.   \def\contscenea{}
  431.   \def\contsceneb{}
  432.   \expandafter\mark\mymark
  433.   \vfill
  434.   \penalty-10000
  435. }
  436. \def\bye{%
  437.   \cleanup
  438.   \end
  439. }
  440. %
  441. % Shortcuts:
  442. %
  443. \def\beat{\paren{beat}}
  444. \def\cut{\trans{cut to}}
  445. \let\dialogue=\dialog
  446. \def\dissolve{\trans{dissolve to}}
  447. \def\ext#1{\scene{ext.\ #1}}
  448. \def\fadein{\open{fade in}}
  449. \def\fadeout{\close{fade out}}
  450. \def\int#1{\scene{int.\ #1}}
  451. \def\os{\paren{off screen}}
  452. \let\shot=\scene
  453. \let\tv=\TV
  454. \def\vo{\paren{voice over}}
  455. %
  456. % Defaults
  457. %
  458. \TV\proof
  459.